package com.pingan.pastry.thread;

import java.util.concurrent.BlockingDeque;

public class ThreadDemo extends Thread {

    private BlockingDeque blockingDeque;

    public ThreadDemo(BlockingDeque blockingDeque) {
        this.blockingDeque = blockingDeque;
    }

    @Override
    public void run() {
        while (true){
            try {
                blockingDeque.take();
            } catch (InterruptedException e) {
                e.printStackTrace();
                break;
            }
        }
    }
}
